package com.lp.module_home_c.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lp.module_home_c.R;
import com.lp.module_home_c.bean.TextBean;

import java.util.List;

/**
 * 作者：created by LP_TREAM on 2020/11/27 21:31
 * 邮箱：806875201@qq.com
 */
public class HomeCTextAdapter extends BaseQuickAdapter<TextBean.DataBean, BaseViewHolder> {

    public HomeCTextAdapter(int layoutResId, @Nullable List<TextBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, TextBean.DataBean item) {
        Glide.with(mContext).load(item.getThumbnail_pic_s()).into((ImageView) helper.getView(R.id.iv_thumbnail_pic_s));
        helper.setText(R.id.tv_title, item.getTitle());
        helper.setText(R.id.tv_author_name, item.getAuthor_name());
        helper.setText(R.id.tv_date, item.getDate());
    }
}
